package org.haier.aws.lambda;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.LambdaLogger;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.SNSEvent;

import java.util.List;

/**
 * @author: SongKun
 * @date: 2021/5/6
 */
public class SnsApp implements RequestHandler<SNSEvent, String> {
    @Override
    public String handleRequest(SNSEvent event, Context context) {
        List<SNSEvent.SNSRecord> records = event.getRecords();
        LambdaLogger logger = context.getLogger();
        logger.log("sns:" + records);
        // System.out.println(records);
        return "200 OK";
    }
}
